class CategoriesController < ApplicationController
	def index
		@categories = Category.where(:parent_id => nil).all
	end
	def show
		@category = Category.find params[:id]
		@videos = Video.where(:category_id => params[:id])
	end
	def create
		@category = Category.create(params[:category])
		redirect_to category_path @category
	end
	def new
		@category = Category.new :parent_id => params[:parent_id]
	end
end
